/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2024-05-22
 * Time: 20:42
 */
public class Deom9 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            try {
            System.out.println("t1线程结束");
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });

        Thread t2= new Thread(() -> {
            try {
                t1.join();
            System.out.println("t2线程结束");
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });


        t1.start();
        t2.start();
        t2.join();
        System.out.println("main线程结束");
    }

}
